<template>
    <div>
        <el-pagination
                background
                layout="prev, pager, next"
                :current-page="currentPage"
                @current-change="currentChange"
                :total="1000">
        </el-pagination>
    </div>
</template>

<script>
    export default {
        name: "ProductSelectPagin",
        data(){
            return{
                currentPage:1
            }
        },
        methods:{
            currentChange(currentPage){
                this.$api.getSelectTbItemAllByPage({
                    page:currentPage
                }).then(res=>{
                    if (res.data.status === 200){
                        this.$emit('getPagingData',res.data.data.result);
                    }else {
                        this. currentPage = 1;
                        alert('数据获取失败');
                    }
                }).catch(error=>{
                    alert('数据获取失败');
                })
            }
        }
    }
</script>

<style scoped>

</style>